﻿@page "/sdk/objects/page/r/{RecordId}/generated-body"

@model WebVella.Erp.Plugins.SDK.Pages.Page.GeneratedBodyModel

@{
	Layout = "~/Pages/_AppMaster.cshtml";
	ViewData["Title"] = "Page Customized Body";
	var pageIconClass = "fa fa-file";
	if (!String.IsNullOrWhiteSpace(Model.ErpPage.IconClass)){
		pageIconClass = Model.ErpPage.IconClass;
	}

}
<wv-page-header color="#dc3545" area-label="Pages" title="@Model.ErpPage.Label" subtitle="Generated Body"
				icon-class="@pageIconClass" return-url="@Model.ReturnUrl">
	<wv-page-header-actions>
	@if (!String.IsNullOrWhiteSpace(Model.PagePublicUrl))
	{
	<a href='@Model.PagePublicUrl' target="_blank" class='btn btn-white btn-sm'><i class='fas fa-external-link-alt'></i> Visit Page</a>
	}
	</wv-page-header-actions>
	<wv-page-header-toolbar>
		@foreach (var action in Model.HeaderToolbar)
		{
			@Html.Raw(action)
		}
	</wv-page-header-toolbar>

</wv-page-header>

<script type="module" src="/_content/WebVella.Erp.Plugins.SDK/js/wv-pb-manager/wv-pb-manager.esm.js"></script>
<script nomodule src="/_content/WebVella.Erp.Plugins.SDK/js/wv-pb-manager/wv-pb-manager.js"></script>

<script>
	var PbManagerLibraryJson = @Html.WvJsonRaw(Model.LibraryJson)
	var PbManagerPageNodesJson = @Html.WvJsonRaw(Model.PageNodeListJson)

</script>

<wv-pb-manager record-id="@Model.SimulationRecordId" page-id="@Model.ErpPage.Id" site-root-url="@Model.ApiUrlRoot" ></wv-pb-manager>

